<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>JQuery Validation Engine</title>
	<link rel="stylesheet" href="../css/validationEngine.jquery.css" type="text/css"/>
	<link rel="stylesheet" href="../css/template.css" type="text/css"/>
	<script src="../js/jquery-1.8.2.min.js" type="text/javascript">
	</script>
	<script src="../js/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8">
	</script>
	<script src="../js/jquery.validationEngine.js" type="text/javascript" charset="utf-8">
	</script>
	<script>

		function showInlinePrompt() {
			$('#footnote-req-target-1').validationEngine('showPrompt', 'Please read the footnote', 'load');
			$('#footnote-req-target-2').validationEngine('showPrompt', 'Please read the footnote', 'load');
			$('#footnote-req-summary').validationEngine('showPrompt', 'Please read the footnote', 'load');
		}

		jQuery(document).ready(function(){
			// binds form submission and fields to the validation engine
			jQuery("#formID").validationEngine();
		});
	</script>
</head>
<body>
	<p>
		This demonstration shows how the per field show prompt position setting work
		<br/>
		<a href="#" onclick="showInlinePrompt()">Show inline prompts on footnotes</a>
	</p>
	<form id="formID" class="formular" method="post" action="" style="width: 800px;">
		<fieldset>
			<legend>
               absolute positioning   
			</legend>
			<label>
				<span>Field is required : </span>
				<input value="" class="validate[required] text-input" type="text" name="req" id="req" />
			</label>
			<label>
                	
				<span>Favorite sport 1:</span>
				<select name="sport" id="sport" class="validate[required]" data-prompt-position="bottomLeft">
					<option value="">Choose a sport</option>
					<option value="option1">Tennis</option>
					<option value="option2">Football</option>
					<option value="option3">Golf</option>
				</select>
			</label>
			<label>
				<span>Favorite sport 2:</span>
				<select name="sport2" id="sport2" multiple class="validate[required]" data-prompt-position="bottomRight">
					<option value="">Choose a sport</option>
					<option value="option1"><li>Tennis</li></option>
						<option value="option2">Football</option>
						<option value="option3">Golf</option>
					</select>
				</label>
				<br/>
				validate[required]
				<legend>
					Custom
				</legend>
				<label>
					<div> Comes with many predifined regex (phone, url, ip, email..etc) </div><a href="demoRegExp.html">[DEMO]</a>
					<br/>
					<span>Enter a URL : </span>
					<input value="http://" class="validate[required,custom[url]] text-input" type="text" name="url" id="url" data-prompt-position="topLeft" />
					<br/>
					validate[required,custom[url]]
				</label>
			</fieldset>
           <fieldset class="inline-prompts">
			<legend>
               inline positioning   
			</legend>
			<label>
				<span>Field is required (inline prompt): </span>
				<input value="" class="validate[required] text-input" type="text" name="req-inline" id="req-inline" data-prompt-position="inline" />
			</label>
		</fieldset>
            
			<fieldset class="inline-prompts">
				<legend>
	               inline positioning with data-prompt-target
				</legend>
			<label>
				<span>Field is required (inline prompt with target): </span>
				<input value="" class="validate[required] text-input" type="text" name="req-target-1" id="req-target-1"  data-prompt-position="inline" data-prompt-target="prompt-req-target-1" />
				<p id="footnote-req-target-1" class="footnote" data-prompt-position="inline">The prompt shown for this field will be put into following container.</p>
				<p id="prompt-req-target-1" class="prompt-target"></p>
			</label>
			<label>
				<span>Field is required (inline prompt with target): </span>
				<input value="" class="validate[required] text-input" type="text" name="req-target-2" id="req-target-2" data-prompt-position="inline" data-prompt-target="prompt-req-target-2" />
				<p id="footnote-req-target-2" class="footnote" data-prompt-position="inline">The prompt shown for this field will be put into following container.</p>
				<p id="prompt-req-target-2" class="prompt-target"></p>
			</label>
		</fieldset>

			<fieldset class="inline-prompts">
				<legend>
	               inline positioning with data-prompt-target to a combined summary
				</legend>
			<p id="prompt-req-summary" class="prompt-summary prompt-target"></p>

			<label>
				<span>Field 1 is required (inline prompt with shared target): </span>
				<input value="" class="validate[required] text-input" type="text" name="req-summary" id="req-summary" data-prompt-position="inline" data-prompt-target="prompt-req-summary" data-errormessage="* Field 1 is required." />
			</label>
            
			<label>
				<span>Field 2 is required (inline prompt with shared target): </span>
				<input value="" class="validate[required] text-input" type="text" name="req-summary-2" id="req-summary-2"  data-prompt-position="inline" data-prompt-target="prompt-req-summary" data-errormessage="* Field 2 is required." />
			</label>
				<p id="footnote-req-summary" class="footnote" data-prompt-position="inline" data-prompt-target="prompt-req-summary">All prompts are appended to the same container.</p>
            
		</fieldset>
            
				<input class="submit" type="submit" value="Validate &amp; Send the form!"/><hr/>
			</form>
		</body>
		</html>
